<?

include '../includes/specs_functions.php';
#------------------------------------------------------------------------
# Connect to PADS
$DB = getDB();
#-------------------------------$Session information
$SESSION = get_session($DB);
$CICUID = $SESSION->Character;
$THEME = $_POST["THEME"];
#---------------------------------------------------

$output = json_encode(array("status"=>"error", "message"=>"NO"));

$specId = $_POST['specId'];
$action = $_POST['action'];

if($CICUID != "" && $specId != ""){

		$table = SPEC_TBL_SPECS;
		$data = array(
				SPEC_TBL_SPECS_PUBLIC."= '".$action."'"
			);
		$where = array(SPEC_TBL_SPECS_ID ."= \"".$specId."\"", SPEC_TBL_SPECS_USER_ID ."= \"".$CICUID."\"");
	
		$result = $DB->Update($table ,$data, $where);
		if ($result[0][1] == 0){
			$output = json_encode(array("status"=>"success", "message"=>"CHANGED"));
		}
}

echo $output; 
#------------------------------------------------------------------------
# Disconnect
leaveDB($DB);
?>